/**
 * Created on Apr 22, 2007
 */
package jvs.vfs;

import java.io.FileFilter;
import java.io.FilenameFilter;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;

/**
 * @author qiangli
 * 
 */
public interface IFile {
	public boolean canExecute();
	
	public boolean canRead();

	public boolean canWrite();

	public boolean copy(URI uri);

	public boolean create();

	public boolean delete();

	public void deleteOnExit();
	
	public boolean execute();

	public boolean exists();

	public Object getAttribute(String name);

	public String getContent();

	public String getContentEncoding();

	public String getContentType();

	public String getDisplayName();

	public Object getIcon();
	
	public InputStream getInputStream();

	public long getLastModified();

	public long getLength();

	public String getName();

	public OutputStream getOutputStream();

	public OutputStream getOutputStream(boolean append);

	public String getPhoneticName();

	public String getSortKey();

	public boolean isDirectory();

	public boolean isEmpty();

	public boolean isFile();

	public boolean isLocal(); // file:/

	public boolean isNative(); // local but not link, not archive

	public String[] list();

	public String[] list(int off, int max);

	//public Cursor listc(FileFilter filter, Comparator<java.io.File> c);

	public IFile[] listFiles();

	public IFile[] listFiles(FileFilter filter);

	public IFile[] listFiles(FilenameFilter filter);

	/**
	 * sort by name first and return the specified range
	 * 
	 * @param off
	 * @param max
	 * @return
	 */
	public IFile[] listFiles(int off, int max);

	//public int listi(int pagesize, Collector<Index> indice);

	public boolean mkdir();

	public boolean move(URI uri);

	public void refresh();

	public boolean setAttribute(String name, Object value);

	public boolean setContent(String s);

	public boolean setContentEncoding(String encoding);

	public boolean setContentType(String mimeType);

	public boolean setInputStream(InputStream in);

	public boolean setLastModified(long time);

	public boolean setLength(long len);

	public boolean setOutputStream(OutputStream out);

	public URI toRealURI();
}
